<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    {if $auth->city_id == 0}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required;length(~10)" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    {/if}

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('Tel')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-tel" data-rule="length(~20)"  class="form-control" name="row[tel]" type="text" value="{$row.tel|htmlentities}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">上午时段</label>
        <div class="col-xs-12 col-sm-8">
            <div class="row row-between">
                <div class="col-xs-6">
                    <input id="c-am_start" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[am_start]" type="text" value="{$row.am_start}" placeholder="开始时间">
                </div>
                <div class="col-xs-6">
                    <input id="c-am_end" data-rule="required" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[am_end]" type="text" value="{$row.am_end}" placeholder="结束时间">
                </div>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">下午时段</label>
        <div class="col-xs-12 col-sm-8">
            <div class="row row-between">
                <div class="col-xs-6">
                    <input id="c-pm_start" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[pm_start]" type="text" value="{$row.pm_start}" placeholder="开始时间">
                </div>
                <div class="col-xs-6">
                    <input id="c-pm_end" data-rule="required" class="form-control datetimepicker" data-date-format="HH:mm:ss" data-use-current="true" name="row[pm_end]" type="text" value="{$row.pm_end}" placeholder="结束时间">
                </div>
            </div>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('Min_price')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_price" data-rule="required" class="form-control" step="0.01" name="row[min_price]" type="number" value="{$row.min_price|htmlentities}">
        </div>
    </div>

    

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('Deliver_fee')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-deliver_fee" data-rule="required" class="form-control" step="0.01" name="row[deliver_fee]" type="number" value="{$row.deliver_fee|htmlentities}">
        </div>
    </div>
    {php}$payTypes = json_decode($row['pay_types'], true);{/php}
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">APP支付:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_checkboxs('row[pay_types][app][]', $payTypeList, $payTypes['app'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">小程序支付:</label>
        <div class="col-xs-12 col-sm-8">
            {:build_checkboxs('row[pay_types][xcx][]', $payTypeList, $payTypes['xcx'])}
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">满额免运费:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-feeprice" data-rule="required" class="form-control" name="row[feeprice]" type="number" value="{$row.feeprice|0}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">满额免餐盒费:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-feepacking" data-rule="required" class="form-control" name="row[feepacking]" type="number" value="{$row.feepacking|0}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">通知公告:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-notice" data-rule="length(~500)" class="form-control" name="row[notice]" rows="3">{$row.notice|htmlentities}</textarea>
        </div>
    </div>

    <hr/>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">最快送达时间(老的逻辑数据):</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-min_price" data-rule="required" class="form-control" step="1" name="row[fasttime]" type="number" value="{$row.fasttime}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">每公里增加的时间:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-time_distance" data-rule="required" class="form-control" name="row[time_distance]" type="number" value="{$row.time_distance|0}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">每公里增加的费用:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-price_distance" data-rule="required" class="form-control" name="row[price_distance]" type="number" value="{$row.price_distance|0}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">起始配送计价距离:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_distance" data-rule="required" class="form-control" name="row[start_distance]" type="number" value="{$row.start_distance|0}">
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">起始公里内配送时间:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-start_distance_time" data-rule="required" class="form-control" name="row[start_distance_time]" type="number" value="{$row.start_distance_time|0}">
        </div>
    </div>

    <hr/>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">写字楼优惠提示</label>
        <div class="col-xs-12 col-sm-8">
            <div class="row row-between">
                <div class="col-xs-6">
                    <input id="c-office_tips" class="form-control" name="row[office_tips]" type="text" value="{$row.office_tips}" placeholder="优惠提示">
                </div>
            </div>
        </div>
    </div>


    {if $auth->city_id == 0}
    <!-- <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div> -->
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-3">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                <label for="row[status]-0"><input id="row[status]-0" name="row[status]" type="radio" value="0" {if $row.status==0}checked{/if} /> 禁用</label>
                <label for="row[status]-1"><input id="row[status]-1" name="row[status]" type="radio" value="1" {if $row.status==1}checked{/if} /> 启用</label>
            </div>
        </div>
    </div>
    {/if}

    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-3"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
